<%-- 
    Document   : dialog_move_to_office
    Created on : 02.04.2014, 10:36:46
    Author     : Corvus 11
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>

<div id="dialog_move_to_office_main" class="dialog-content">
    <div>
       <input type="hidden" id="move_office_id" value="-1">
    </div>
        
    <core:if test="${movedComponents != null}">
    <p><strong>Вместе с устройством будут перемещены комплектующие: </strong></p>
    <table class="table striped bordered">
        <thead>
            <tr>
                <th>Тип</th>
                <th>Модель</th>
                <th>Номер</th>
            </tr>
        </thead>
        <tbody>
            <core:forEach items="${movedComponents}" var = "component">
            <tr>
                <td>${component.componentType.name}</td>
                <td>${component.description}</td>
                <td>${component.serial}</td>
            </tr>
            </core:forEach>
        </tbody>
    </table>
    </core:if>

    <p>Дата перемещения:</p>
    <div id='select_date_div' class='input-control text' data-role='datepicker' data-locale='ru' style="width: 250px">
        <input id='select_date_data' type='text'>
        <button type='button' class='btn-date'></button>
    </div>
    
    <p>Офис: </p>
    <div class="input-control select" data-role="input-control" style="width: 250px">    
        <select id="dialog_mto_select_office" onchange="mtoOfficeChanged();">
            <option value="-1">Выберите офис</option>
            <core:forEach items="${officeNameList}" var="office">
                <option value="${office.id}">${office.name}</option>
            </core:forEach>
        </select>
   </div>
    <div style="height: 30px">
        <button class="button place-right" onclick="moveComponentToOffice(${movedId});">Да</button>
        <button class="button place-right" onclick="$.Dialog.close();">Отменить</button>
    </div>
</div>
